<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="/css/bootstrap.min.css">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
	<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
	<title>Document</title>
	<style>
		aside {
			background-color: #2e3f50;
			width: 15%;
			height: 100vh;
			float: left;
			color: #fff;
			padding: 30px;
			display: flex;
			flex-direction: column;
			justify-content: start;
			align-items: center;
		}

		header {
			width: 85%;
			background-color: #5268b7;
			color: #fff;
			height: 70px;
			float: right;
			border-radius: 2px;
		}

		.name {
			margin: 10px 0;
			line-height: 60px;
		}

		aside a {
			color: #fff;
		}
		aside a:hover {
			color: #999;
			text-shadow: 3px 3px 5px #000;
		}
		aside a.active {
			color: #999;
			text-shadow: 3px 3px 5px #000;
		}

		main {
			width: 85%;
			float: right;
		}
	</style>
</head>
<body>

	<aside class="shadow">
		<p class="h3">smbms</p>
		<p class="name"><span th:text="${session.username}">李明</span></p>
		<nav class="nav flex-column">
			<a class="nav-link" href="/home">
				<i class="bi bi-house-door-fill"></i>
				<span>首页</span>
			</a>
			<a class="nav-link" href="/showUser">
				<i class="bi bi-people-fill"></i>
				<span>用户管理</span>
			</a>
			<a class="nav-link active" href="#">
				<i class="bi bi-receipt-cutoff"></i>
				<span>账单管理</span>
			</a>
			<a class="nav-link" href="/showProvider">
				<i class="bi bi-cart-fill"></i>
				<span>供应商管理</span>
			</a>
			<a class="nav-link" href="/editPasswordHTML">
				<i class="bi bi-gear-fill"></i>
				<span>个人设置</span>
			</a>
			<a class="nav-link" href="/quit">
				<i class="bi bi-box-arrow-left"></i>
				<span>退出</span>
			</a>
		</nav>
	</aside>

	<header class="navbar shadow">
		<h3>超市账单管理系统</h3>
	</header>

	<main>
		<nav aria-label="breadcrumb">
			<ol class="breadcrumb">
				<li class="breadcrumb-item"><a href="./home.html">Home</a></li>
				<li class="breadcrumb-item active" aria-current="page">账单管理</li>
			</ol>
		</nav>

		<div class="container">
			<form action="/showBill">
				<div class="row">
					<!-- <label for="goodname" class="col-sm-1 col-form-label">商品名称</label> -->
					<div class="col-sm-2">
						<input type="text" placeholder="请输入商品名" name="goodName" class="form-control" id="goodname">
					</div>
					<!-- <label for="goodname" class="col-sm-1 col-form-label">供应商名称</label> -->
					<div class="col-sm-2">
						<input type="text" placeholder="请输入供应商" name="providerName" class="form-control" id="username">
					</div>

					<input class="btn btn-primary" type="submit" value="查询"/>
					<a href="/addBillHTML"><button class="btn btn-info" style="margin-left: 20px;" type="button">添加账单</button></a>
				</div>
			</form>

			<div class="table-responsive" style="margin-top: 30px;">
				<table class="table table-bordered shadow-sm">
					<tr>
						<th>账单编码</th>
						<th>商品名称</th>
						<th>供应商</th>
						<th>账单金额</th>
						<th>是否付款</th>
						<th>操作</th>
					</tr>
					<tr th:each="bill:${pageInfo.list}">
						<td th:text="${bill.billcode}">hanlu</td>
						<td th:text="${bill.goodid}">韩露</td>
						<td th:text="${bill.providerid}">女</td>
<!--						<td th:text="${bill.count * goods.getid(bill.goodid).price}">20</td>-->
						<td th:text="${bill.count}">20</td>
						<td th:text="${bill.ispayment.equals('1') ? '否' : '是'}">15918230478</td>
						<td>
<!--							<button class="btn btn-primary btn-sm" type="button">编辑</button>-->
							<a th:href="@{/deleteBill(billcode=${bill.billcode})}"><button class="btn btn-danger btn-sm" type="button">删除</button></a>
						</td>
					</tr>
				</table>
			</div>

			<!-- 分页 -->
			共<span th:text="${pageInfo.total}">4</span>条记录，
			<span th:text="${pageInfo.pageNum}">1</span>/<span
				th:text="${pageInfo.pages}">4</span>
			<a th:if="${pageInfo.pageNum}==1"
			   href="javascript:void(0)">上一页</a>
			<a href="#" th:if="${pageInfo.pageNum}!=1"
			   th:href="@{/showBill(pageNum=${pageInfo.pageNum}-1)}">上一页</a>
			<span
					th:each="i:${#numbers.sequence(1,pageInfo.pages)}">
               <a th:href="@{/showBill(pageNum=${i})}"
				  th:text="${i}">1</a>
			</span>
			<a href="#"
			   th:if="${pageInfo.pageNum}!=${pageInfo.pages}"
			   th:href="@{/showBill(pageNum=${pageInfo.pageNum}+1)}">下一页</a>
			<a
					th:if="${pageInfo.pageNum}==${pageInfo.pages}"
					href="javascript:void(0)">下一页</a>

			<!-- 模态框 -->

		</div>
	</main>

</body>
	<script>

	</script>
</html>